package com.uam.core.entity.constant;

import lombok.Getter;
import lombok.ToString;

import java.util.concurrent.TimeUnit;

/**
 * @author admin
 */
@Getter
@ToString
public enum RedisLockKeyEnum {
    /**
     * 添加终端
     */
    ROUTE_TASK("ROUTE_TASK", 30, 200, TimeUnit.SECONDS, "路由进行中"),
    ROUTE_FINISH("ROUTE_FINISH", 10, 20, TimeUnit.SECONDS, "任务完成"),
  ;

    private String key;
    /**
     * 锁时长
     */
    private long leaseTime;
    /**
     * 等待锁时长
     */
    private long waitTime;
    /**
     * 锁单位
     */
    private TimeUnit timeUnit;
    private String msg;

    RedisLockKeyEnum(String key, long leaseTime, long waitTime, TimeUnit timeUnit, String msg) {
        this.msg = msg;
        this.key = key;
        this.leaseTime = leaseTime;
        this.waitTime = waitTime;
        this.timeUnit = timeUnit;
    }

}
